package com.pg.entity.dd;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import org.hibernate.validator.constraints.Length;
import org.jeecgframework.poi.excel.annotation.Excel;
import org.springframework.format.annotation.DateTimeFormat;

import javax.validation.constraints.DecimalMax;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.util.Date;

/**
 * <p>
 * 销售订单
 * </p>
 *
 * @author likl
 * @since 2020-06-17
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
public class EipSalesOrder implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 全库唯一码
     */
    @NotNull(message = "全库唯一码不能为空")
    @Length(max = 64, message = "全库唯一码过长")
    @TableId
    private String puid;

    /**
     * 采购方总部编码
     */
    @NotNull(message = "采购方总部编码不能为空")
    @Length(max = 8, message = "采购方总部编码过长")
    @Excel(name = "采购方总部编码")
    @TableField("\"purchaserHqCode\"")
    private String purchaserHqCode;

    /**
     * 销售订单号
     */
    @NotNull(message = "销售订单号不能为空")
    @Length(max = 16, message = "销售订单号过长")
    @Excel(name = "销售订单号")
    @TableField("\"soNo\"")
    private String soNo;

    /**
     * 供应商编码
     */
    @NotNull(message = "供应商编码不能为空")
    @Length(max = 16, message = "供应商编码过长")
    @Excel(name = "供应商编码")
    @TableField("\"supplierCode\"")
    private String supplierCode;
    /**
     * 供应商名称
     */
    @NotNull(message = "供应商名称不能为空")
    @Length(max = 64, message = "供应商名称过长")
    @Excel(name = "供应商名称")
    @TableField("\"supplierName\"")
    private String supplierName;
    /**
     * 采购方公司编码
     */
    @NotNull(message = "采购方公司编码不能为空")
    @Length(max = 16, message = "采购方公司编码过长")
    @Excel(name = "采购方公司编码")
    @TableField("\"buyerCode\"")
    private String buyerCode;
    /**
     * 采购方公司名称
     */
    @NotNull(message = "采购方公司名称不能为空")
    @Length(max = 128, message = "采购方公司名称过长")
    @Excel(name = "采购方公司名称")
    @TableField("\"buyerName\"")
    private String buyerName;
    /**
     * 采购方区域
     */
    @Length(max = 64, message = "采购方区域过长")
    @Excel(name = "采购方区域")
    @TableField("\"buyerArea\"")
    private String buyerArea;
    /**
     * 采购方公司省份
     */
    @Length(max = 64, message = "采购方公司省份过长")
    @Excel(name = "采购方公司省份")
    @TableField("\"buyerProvince\"")
    private String buyerProvince;

    /**
     * 销售订单与采购订单的关联方式
     */
    @Length(max = 12, message = "销售订单与采购订单的关联方式过长")
    @Excel(name = "销售订单与采购订单的关联方式")
    @TableField("\"supplierSoRelType\"")
    private String supplierSoRelType;

    /**
     * 采购订单id或者采购订单行项目id
     */
    @Length(max = 512, message = "采购订单id或者采购订单行项目id过长")
    @Excel(name = "采购订单id或者采购订单行项目id")
    @TableField("\"eipPoNo\"")
    private String eipPoNo;

    /**
     * 品类编码
     */
    @NotNull(message = "品类编码不能为空")
    @Length(max = 8, message = "品类编码过长")
    @Excel(name = "品类编码")
    @TableField("\"categoryCode\"")
    private String categoryCode;

    /**
     * 种类编码
     */
    @NotNull(message = "种类编码不能为空")
    @Length(max = 8, message = "种类编码过长")
    @Excel(name = "种类编码")
    @TableField("\"subclassCode\"")
    private String subclassCode;

    /**
     * 销售订单状态
     */
    @Length(max = 1, message = "销售订单状态过长")
    @TableField("\"soStatus\"")
    private String soStatus;

    /**
     * 数据来源
     */
    @NotNull(message = "数据来源不能为空")
    @Length(max = 8, message = "数据来源过长")
    @Excel(name = "数据来源")
    @TableField("\"dataSource\"")
    private String dataSource;

    /**
     * 来源数据创建时间
     */
    @NotNull(message = "来源数据创建时间不能为空")
    @TableField("\"salesOrderDataSourceCreateTime\"")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date salesOrderDataSourceCreateTime;

    /**
     * 逻辑删除
     */
    @NotNull(message = "逻辑删除不能为空")
    @Length(max = 64, message = "逻辑删除过长")
    @TableField("\"salesOrderIsDeleted\"")
    private String salesOrderIsDeleted;

    /**
     * 更新时间
     */
    @NotNull(message = "更新时间不能为空")
    @Length(max = 64, message = "更新时间过长")
    @TableField("\"ModifyTime\"")
    private String ModifyTime;

    /**
     * 预留字段1
     */
    private String remark1;

    /**
     * 预留字段2
     */
    private String remark2;

    /**
     * 预留字段3
     */
    private String remark3;

    /**
     * 预留字段4
     */
    private String remark4;

    /**
     * 预留字段5
     */
    private String remark5;

    /**
     * 状态表示
     */
    private String ioflag;

    /**
     * 错误信息
     */
    private String message;

    /**
     * 本条数据是新增/更新
     */
    private String status;

    /**
     * 全局流水号
     */
    private String transno;

    /**
     * 行项目puid
     */
    @NotNull(message = "行项目puid不能为空")
    @Length(max = 64, message = "行项目puid过长")
    @TableField("\"salesOrderLinenumPuid\"")
    private String salesOrderLinenumPuid;


    /**
     * 销售订单行项目号
     */
    @NotNull(message = "销售订单行项目号不能为空")
    @Length(max = 8, message = "销售订单行项目号过长")
    @TableField("\"soItemNo\"")
    private String soItemNo;

    /**
     * 采购订单行项目ID
     */
    @Length(max = 512, message = "采购订单行项目ID过长")
    @TableField("\"poItemId\"")
    private String poItemId;

    /**
     * 物资编码
     */
    @NotNull(message = "物资编码不能为空")
    @Length(max = 32, message = "物资编码过长")
    @TableField("\"productCode\"")
    private String productCode;

    /**
     * 物资名称
     */
    @NotNull(message = "物资名称不能为空")
    @Length(max = 64, message = "物资名称过长")
    @TableField("\"productName\"")
    private String productName;

    /**
     * 物资单位
     */
    @NotNull(message = "物资单位不能为空")
    @Length(max = 32, message = "物资单位过长")
    @TableField("\"productUnit\"")
    private String productUnit;

    /**
     * 物资数量
     */
    @NotNull(message = "物资数量不能为空")
    @DecimalMax(value = "18", message = "物资数量过长")
    @TableField("\"productAmount\"")
    private String productAmount;

    /**
     * 物资id分组编号
     */
    @Length(max = 32, message = "物资id分组编号过长")
    @TableField("\"productIdGrpNo\"")
    private String productIdGrpNo;

    /**
     * 采购订单厂家计划交货日期
     */
    @NotNull(message = "采购订单厂家计划交货日期不能为空")
    @TableField("\"planDeliveryDate\"")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @JsonFormat(pattern = "yyyy-MM-dd")
    private Date planDeliveryDate;

    /**
     * 采购订单厂家发货地点
     */
    @Length(max = 8, message = "采购订单厂家发货地点过长")
    @TableField("\"planDeliveryPlace\"")
    private String planDeliveryPlace;

    /**
     * 采购订单厂家发货地点描述
     */
    @Length(max = 32, message = "采购订单厂家发货地点描述过长")
    @TableField("\"planDeliveryPlaceDesc\"")
    private String planDeliveryPlaceDesc;

    /**
     * 数据拥有方
     */
    @Length(max = 16, message = "数据拥有方过长")
    @TableField("\"ownerId\"")
    private String ownerId;

    /**
     * 数据可见方
     */
    @Length(max = 16, message = "数据可见方过长")
    @TableField("\"openId\"")
    private String openId;

    /**
     * 合同编号
     */
    @Length(max = 32, message = "合同编号过长")
    @TableField("\"conCode\"")
    private String conCode;

    @TableField("\"salesOrderLinenumIsDeleted\"")
    private String salesOrderLinenumIsDeleted;

    @TableField("\"salesOrderLinenumDataSourceCreateTime\"")
    private String salesOrderLinenumDataSourceCreateTime;

}
